﻿Public Class AddStudentGrades

    Inherits System.Web.UI.Page

    Dim ws As New DO_NOT_MOVE_ME_FROM_THIS_PROJECT.DARSWebservice
    Dim studID As String
    Dim studInfoDS As DataSet
    Dim semCode As String
    Dim studentName As String

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Check if user is logged in
        If Session("CurrentUser") Is Nothing Then
            Response.Redirect("NotLoggedIn.aspx")
            Exit Sub
        End If
        If Not IsPostBack Then
            ddlSemester.Visible = False
            lblChooseSem.Visible = False
            'btnViewSemester.Visible = False
            gvSemesterCourses.Visible = False
            '  lblShowID.Visible = False
            lblShowName.Visible = False
            lblShowSemester.Visible = False
            ' btnAddCourse.Visible = False
        Else
            ' studID = CStr(Session("vStudentID"))
        End If

        studID = txtStudentID.Text
    End Sub





    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnSubmit.Click
        studID = txtStudentID.Text
        Session("vStudentID") = studID
        Dim dsN As DataSet = ws.getStudentPersonalInfo(studID)
        studentName = CStr(dsN.Tables(0).Rows(0)("FirstName")) & " " & CStr(dsN.Tables(0).Rows(0)("LastName"))
        lblShowName.Text = studentName
        lblShowName.Visible = True
        lblChooseSem.Visible = True
        ddlSemester.Visible = True
        ' btnViewSemester.Visible = True


    End Sub

    'Protected Sub btnViewSemester_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnViewSemester.Click
    '    'studID = txtStudentID.Text
    '    ''studInfoDS = ws.getSemesterCourses(studID, semCode)

    '    'lblShowID.Visible = True
    '    ''lblShowName.Visible = True
    '    'lblShowSemester.Visible = True

    '    'lblShowID.Text = txtStudentID.Text
    '    ''lblShowName.Text = studentName
    '    'lblShowSemester.Text = ddlSemester.SelectedItem.Text

    '    'Session("vStudentID") = studID

    '    'gvSemesterCourses.Visible = True
    '    '' btnAddCourse.Visible = True

    'End Sub

    'Protected Sub btnAddCourse_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAddCourse.Click
    '    Session("vStudentID") = studID

    'End Sub

    Protected Sub ddlSemester_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ddlSemester.SelectedIndexChanged
        studID = txtStudentID.Text
        'studInfoDS = ws.getSemesterCourses(studID, semCode)

        '  lblShowID.Visible = True
        'lblShowName.Visible = True
        lblShowSemester.Visible = True

        ' lblShowID.Text = txtStudentID.Text
        'lblShowName.Text = studentName
        lblShowSemester.Text = ddlSemester.SelectedItem.Text

        Session("vStudentID") = studID

        gvSemesterCourses.Visible = True
        ' btnAddCourse.Visible = True\

        gvSemesterCourses.DataBind()
    End Sub

    Protected Sub logout(ByVal sender As Object, ByVal e As EventArgs) Handles btnLogout.ServerClick
        Session.Abandon()
        Response.Redirect("NotLoggedIn.aspx")
    End Sub

    Protected Sub home(ByVal sender As Object, ByVal e As EventArgs) Handles btnhome.ServerClick
        Response.Redirect("AdvisorLandingPage.aspx")
    End Sub
End Class